package com.zxm.sunshineaiary.view.flinggallery.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

public class FingGalleryAdapter {

	private Context mContext;
	private View[] mViews;

	private int high = 100;
	private int widht = 100;
	private int mPadding = 0;

	
	public  FingGalleryAdapter(Context context, View[] viws) {
		this.mContext = context;
		this.widht = widht;
		this.high = high;
		this.mViews = addLayout(viws);
	}

	
	/**
	 * 
	 * @param context
	 * @param viws
	 */
	public FingGalleryAdapter(Context context, View[] viws, int widht,
			int high, int padding) {
		this.mContext = context;
		this.widht = widht;
		this.high = high;
		this.mPadding = padding;
		this.mViews = addLayout(viws);
	}

	public View getItem(int posation) {
		return mViews[posation];
	}

	public View[] getItems() {
		return mViews;

	}

	public int getCount() {
		if (null != mViews) {
			return mViews.length;
		}
		return 0;
	}

	public int getViewWidht() {
		return widht;
	}

	public int getViewHigh() {
		return high + mPadding;
	}

	private View[] addLayout(View[] views) {
		for (int i = 0; i < views.length; i++) {
			LayoutParams lp = new LayoutParams(widht, high);
			views[i].setLayoutParams(lp);
		}
		return views;
	}
}
